package org.nightknight.satobee.cli;

import java.net.Socket;
import java.util.Scanner;

import org.nightknight.satobee.core.Conversation;
import org.nightknight.satobee.core.IConRecListener;
import org.nightknight.satobee.core.IMesRecListener;
import org.nightknight.satobee.core.Message;
import org.nightknight.satobee.core.Server;

public class ServerMain {
/*	
	private Conversation conv = null;
	private Server server = Server.getServer();
	private Scanner in = new Scanner(System.in);

	public ServerMain() {
		server.addConvRecListener(new IConRecListener() {

			@Override
			public void convRecListener(Socket s) {
				// TODO Auto-generated method stub
				conv = new Conversation(s);
				conv.addMessageReceivedListener(new IMesRecListener() {
					@Override
					public void messageReceived(Message message) {
						System.out.println(conv.getSocket().getInetAddress().getHostAddress() + ": " + message);
					}
				});
				System.out.println(conv.getSocket().getInetAddress().getHostAddress());
			}
			
		});
		
		(new Thread() {
			public void run() {
				String line = null;
				while (in.hasNextLine()) {
					line = in.nextLine();
					System.out.println("echo >> " + line);
//					conv.sendMessage(line);
				}
			}
		}).start();
	}
	
	public static void main(String[] args) {
		new ServerMain();
	}
     * 
     */
}
